﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WebHacker;
using System.Web;

namespace HttpTest
{
    public partial class Form_MCD_Auto : Form
    {
        public Form_MCD_Auto()
        {
            InitializeComponent();
        }

        private void Form_MCD_Auto_Load(object sender, EventArgs e)
        {

        }
        private void button1_Click(object sender, EventArgs e)
        {
            var wt =
                new WebTools();

            string str =
            wt.SubmitFormDataStr(@"http://54.56.18.228:8080/ja-jp/Account/LogOn", @"UserName=900000&Password=000000&RememberMe=false");
            MessageBox.Show(str);
            str =
            wt.SubmitFormDataStr(@"http://54.56.18.228:8080/ja-JP/GPOTC/Received", @"ReceiveDate=");
            MessageBox.Show(str);

            str =
            wt.SubmitFormDataStr(@"http://54.56.18.228:8080/ja-JP/GPPTP/PTPReceived", @"ReceiveDate=");
            MessageBox.Show(str);
            str =
            wt.SubmitFormDataStr(@"http://54.56.18.228:8080/ja-JP/GPEEM/EEMReceived", @"ReceiveDate=");
            MessageBox.Show(str);
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPAHPTP/AHPTPReceived", @"ReceiveDate=");
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPAHEEM/AHEEMReceived", @"ReceiveDate=");
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPMDM/MDMReceived", @"ReceiveDate=");
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPMDMHCP/MDMHCPReceived", @"ReceiveDate=");
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPOTC/Received", @"ReceiveDate=");
            //wt.SubmitFormData(@"http://54.56.18.228:8080/ja-JP/GPRTR/RTRReceived", @"ReceiveDate=");
        }

        private void button1_Click1(object sender, EventArgs e)
        {
            var wt =
                new WebTools();


            //wt.SubmitFormData(@"http://localhost/MCDL/Account/LogOn", @"LoginName=sysadmin&Password=112233&RememberMe=false");
            wt.SubmitFormData(@"http://58.2.221.87:80/MCDL/Account/LogOn", @"LoginName=sysadmin&Password=112233&RememberMe=false");
            //wt.SubmitFormData(@"http://58.2.219.90:1303/Account/LogOn", @"LoginName=sysadmin&Password=000000&RememberMe=false");
            var strDate =
                HttpUtility.UrlEncode((DateTime.Now.ToString("yyyy/MM/dd")));
            //wt.HttpRequest(@"http://58.2.221.87/MCDL/NonPOGP/CaseMonitor?rd=0.307972299400717", new RequestHeaders());


            //wt.SubmitFormData(@"http://58.2.219.90:1303/ja-JP/NonPOGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87:80/MCDL/ja-JP/NonPOGP/Received", @"ReceiveDate=" + strDate);
            //wt.SubmitFormData(@"http://localhost/MCDL/ja-JP/NonPOGP/Received", @"ReceiveDate=" + strDate);
        //    wt =
        //        new WebTools();
            //wt.SubmitFormData(@"http://58.2.219.90:1303/ja-JP/POGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87:80/MCDL/ja-JP/POGP/Received", @"ReceiveDate=" + strDate);
            //http://58.2.219.90:1303/
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/ARGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/DCSupportGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/FAHRAPARGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/FAOthersGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/JVPaymentGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/LOFCGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/MarketingGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/OverseasPaymentGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/PaymentClearingGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/StoreAcctGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/TaxGLAPARVoucherGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/TEGP/Received", @"ReceiveDate=" + strDate);
            wt.SubmitFormData(@"http://58.2.221.87/MCDL/ja-JP/TreasuryAPARVoucherGP/Received", @"ReceiveDate=" + strDate);
        }
    }
}
